package archsw0904.controller.authentication;

public class AuthenticationManagerProxy implements archsw0904.controller.authentication.AuthenticationManager {
  private String _endpoint = null;
  private archsw0904.controller.authentication.AuthenticationManager authenticationManager = null;
  
  public AuthenticationManagerProxy() {
    _initAuthenticationManagerProxy();
  }
  
  public AuthenticationManagerProxy(String endpoint) {
    _endpoint = endpoint;
    _initAuthenticationManagerProxy();
  }
  
  private void _initAuthenticationManagerProxy() {
    try {
      authenticationManager = (new archsw0904.controller.authentication.AuthenticationManagerServiceLocator()).getAuthenticationManagerPort();
      if (authenticationManager != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)authenticationManager)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)authenticationManager)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (authenticationManager != null)
      ((javax.xml.rpc.Stub)authenticationManager)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public archsw0904.controller.authentication.AuthenticationManager getAuthenticationManager() {
    if (authenticationManager == null)
      _initAuthenticationManagerProxy();
    return authenticationManager;
  }
  
  public archsw0904.controller.authentication.ProfileClient getClientProfile(java.lang.Integer arg0) throws java.rmi.RemoteException{
    if (authenticationManager == null)
      _initAuthenticationManagerProxy();
    return authenticationManager.getClientProfile(arg0);
  }
  
  public java.lang.String getRoleByToken(java.lang.Integer arg0) throws java.rmi.RemoteException{
    if (authenticationManager == null)
      _initAuthenticationManagerProxy();
    return authenticationManager.getRoleByToken(arg0);
  }
  
  public java.lang.Integer getUserIdByToken(java.lang.Integer arg0) throws java.rmi.RemoteException{
    if (authenticationManager == null)
      _initAuthenticationManagerProxy();
    return authenticationManager.getUserIdByToken(arg0);
  }
  
  public int logIn(java.lang.String arg0, java.lang.String arg1) throws java.rmi.RemoteException{
    if (authenticationManager == null)
      _initAuthenticationManagerProxy();
    return authenticationManager.logIn(arg0, arg1);
  }
  
  public void logOut(int arg0) throws java.rmi.RemoteException{
    if (authenticationManager == null)
      _initAuthenticationManagerProxy();
    authenticationManager.logOut(arg0);
  }
  
  
}